<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
	xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
	xmlns:fox="http://www.camunda.com/fox"
	targetNamespace="Examples">

	<process id="boundaryEventWithFailedJobRetryTimeCycle" isExecutable="true">

		<startEvent id="theStart" />
		<sequenceFlow id="flow1" sourceRef="theStart" targetRef="task" />
        
        <userTask id="task" name="Task rigged with timer" />
		<sequenceFlow id="flow2" sourceRef="task" targetRef="theEnd" />
   

		<boundaryEvent id="boundaryTimerWithFailedJobRetryTimeCycle" cancelActivity="true" attachedToRef="task">
			<extensionElements>
        		<fox:failedJobRetryTimeCycle>R5/PT5M</fox:failedJobRetryTimeCycle>
        	</extensionElements>
			<timerEventDefinition>
			  <timeDuration>PT2H</timeDuration>
			</timerEventDefinition>
		</boundaryEvent>
    
		<sequenceFlow id="flow3" sourceRef="boundaryTimerWithFailedJobRetryTimeCycle" targetRef="theEnd" />
		
		<endEvent id="theEnd" />

	</process>
	
		<process id="boundaryEventWithoutFailedJobRetryTimeCycle" isExecutable="true">

		<startEvent id="theStart1" />
		<sequenceFlow id="flow11" sourceRef="theStart1" targetRef="task1" />
        
        <userTask id="task1" name="Task rigged with timer" />
		<sequenceFlow id="flow21" sourceRef="task1" targetRef="theEnd1" />
   

		<boundaryEvent id="boundaryTimerWithoutFailedJobRetryTimeCycle" cancelActivity="true" attachedToRef="task1">
			<timerEventDefinition>
			  <timeDuration>PT2H</timeDuration>
			</timerEventDefinition>
		</boundaryEvent>
    
		<sequenceFlow id="flow31" sourceRef="boundaryTimerWithoutFailedJobRetryTimeCycle" targetRef="theEnd1" />
		
		<endEvent id="theEnd1" />

	</process>
	
	<process id="startEventWithFailedJobRetryTimeCycle" isExecutable="true">

		<startEvent id="startEventFailedJobRetryTimeCycle" >
			<extensionElements>
        		<fox:failedJobRetryTimeCycle>R5/PT5M</fox:failedJobRetryTimeCycle>
        	</extensionElements>
			<timerEventDefinition>
			  <timeDuration>PT2H</timeDuration>
			</timerEventDefinition>
		</startEvent>
		
		<sequenceFlow id="flow12" sourceRef="startEventFailedJobRetryTimeCycle" targetRef="task2" />
        
        <userTask id="task2" name="Task rigged with timer" />
		<sequenceFlow id="flow22" sourceRef="task2" targetRef="theEnd2" />
   
		
		<endEvent id="theEnd2" />

	</process>
	
	<process id="intermediateTimerEventWithFailedJobRetryTimeCycle" isExecutable="true">

        <startEvent id="theStart3"/>
        <sequenceFlow id="flow13" sourceRef="theStart3" targetRef="timerEventWithFailedJobRetryTimeCycle"/>

        <intermediateCatchEvent id="timerEventWithFailedJobRetryTimeCycle">
        	<extensionElements>
        		<fox:failedJobRetryTimeCycle>R5/PT5M</fox:failedJobRetryTimeCycle>
        	</extensionElements>
            <timerEventDefinition>
                <timeDuration>PT5M</timeDuration>
            </timerEventDefinition>
        </intermediateCatchEvent>

        <sequenceFlow id="flow23" sourceRef="timerEventWithFailedJobRetryTimeCycle" targetRef="theEnd3"/>

        <endEvent id="theEnd3"/>

    </process>

</definitions>